# Contributor: mio <miyopan@e.email>
# Maintainer: mio <miyopan@e.email>
pkgname=mypaint
pkgver=2.0.1
pkgrel=0
pkgdesc="Fast and dead-simple painting app for artists"
url="https://mypaint.app/"
license="GPL-2.0-or-later"
# s390x: fails big endian tests
arch="all !s390x"
depends="
	mypaint-brushes2
	py3-cairo
	py3-gobject3
	py3-numpy
	"
# Required for tests: py3-cairo py3-gobject3
makedepends="
	glib-dev
	gtk+3.0-dev
	lcms2-dev
	libmypaint-dev
	libpng-dev
	mypaint-brushes2-dev
	python3-dev
	py3-cairo
	py3-numpy-dev
	py3-gobject3-dev
	py3-setuptools
	py3-wheel
	swig
	"
subpackages="$pkgname-pyc $pkgname-lang"
source="mypaint-v$pkgver.tar.gz::https://github.com/mypaint/mypaint/archive/v$pkgver.tar.gz
	fix-invalid-mode-ru.patch"

build() {
	python setup.py build_config
	python setup.py build
}

check() {
	python setup.py test
}

package() {
	python setup.py install --root="$pkgdir" --skip-build
}

pyc() {
	pkgdesc="Precompiled Python bytecode for ${subpkgname%-pyc}"
	install_if="${subpkgname%-pyc}=$pkgver-r$pkgrel pyc"

	cd "$pkgdir" || return 0
	local IFS='
'
	amove $(find usr/lib -type d -name __pycache__)
}

sha512sums="
80983bb70234c4f5fbcc0c13d0e6bb8d20198ec18e22c395d42814b9c7a6621bdd0b1c395ac8067b19bb7a47400514c99aa3ebdad2ddb4859f9446c43beb51ea  mypaint-v2.0.1.tar.gz
ad87fcf5b76db88ff495e260e12dd24d3309d5e8897a88ed836e4df4bc09f7188ef1e17a8190a94020a4d0c978017b99f7afcaf88d99dce12b9037d663e37157  fix-invalid-mode-ru.patch
"
